package communication.server;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.ArrayList;

import communication.Message;
import communication.MessageType;
import communication.message.GameId;
import communication.message.Player;

public class GMHandle extends Handle {	
	
	public GMHandle(DataInputStream input, DataOutputStream output) {
		super(input, output);
	}
	
	public void startGame(String id, ArrayList<Player> players) throws IOException {
		Message msg = new Message(MessageType.BEGIN_GAME);
		msg.setGameId(new GameId(id));
		for (Player player : players)
			msg.addPlayer(player);
		super.send(msg);
	}
	
	public void sendMessage(Message msg) throws IOException {
		super.send(msg);
	}
}
